using System.Windows;
using Columbus.Controls;

namespace Columbus.ActionResults
{
    /// <summary>
    /// Dialog result is returned to display dialog above current content of navigation frame
    /// </summary>
    public class DialogResult : ViewResult
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DialogResult"/> class.
        /// </summary>
        /// <param name="viewName">Name of the view.</param>
        /// <param name="model">(View)Model.</param>
        /// <param name="context">Navigation context.</param>
        public DialogResult(string viewName, object model, NavigationContext context) 
            : base(viewName, model, context)
        {
        }

        /// <summary>
        /// Renders view.
        /// </summary>
        /// <param name="navigationFrame">Navigation frame.</param>
        /// <param name="view">View.</param>
        protected override void RenderView(Frame navigationFrame, FrameworkElement view)
        {
            navigationFrame.ShowDialog(view);
        }
    }
}